#ifndef __RING_BUF_H_
#define __RING_BUF_H_

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

#define RINGBUF_SIZE 			(10)
#define RINGBUF_SUCCESS			(0)
#define RINGBUF_MALLOC_FAILED 	(-1)
#define RINGBUF_NULL			(-2)
#define RINGBUF_FULL			(-3)
#define RINGBUF_NOT_FULL		(-4)
#define RINGBUF_FAILED			(-5)
#define RINGBUF_EMPTY			(-6)
#define RINGBUF_NOT_EMPTY		(-7)


typedef struct _ring_buf
{
	int head;
	int tail;
	int size;
	uint8_t *buf;
}rint_buf_t;


int ring_buf_init(rint_buf_t *ring_buf);
int add_to_ring_buf(rint_buf_t *ring_buf, uint8_t data);
int is_ring_buf_full(rint_buf_t *ring_buf);
int remove_from_ring_buf(rint_buf_t *ring_buf,uint8_t *data);



#endif
